#!/usr/bin/env bash

set -e

FRONTEND_VERSION="20220906112053"
EXPERIMENTAL_FRONTEND_VERSION="20230105194043"

rm -rf ./custom_components/hacs/hacs_frontend
rm -rf ./custom_components/hacs/hacs_frontend_experimental

python3 -m pip --disable-pip-version-check install -U --target=./custom_components/hacs "hacs_frontend==$EXPERIMENTAL_FRONTEND_VERSION"
rm -rf ./custom_components/hacs/*.dist-info
mv ./custom_components/hacs/hacs_frontend ./custom_components/hacs/hacs_frontend_experimental

python3 -m pip --disable-pip-version-check install -U --target=./custom_components/hacs "hacs_frontend==$FRONTEND_VERSION"
rm -rf ./custom_components/hacs/*.dist-info